﻿using System;
using System.Collections.Generic;
using System.Xml;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x02000AD4 RID: 2772
	internal class AINodeFactory
	{
		// Token: 0x0600A5A6 RID: 42406 RVA: 0x001CD56C File Offset: 0x001CB76C
		public static AIRunTimeNodeBase CreateAINodeByName(string nodeName, XmlElement xmlNode)
		{
			AIRunTimeNodeBase result;
			if (nodeName == "Selector")
			{
				result = new AIRunTimeSelectorNode(xmlNode);
			}
			else if (nodeName == "Sequence")
			{

				result = new AIRunTimeSequenceNode(xmlNode);
			}
			else if (nodeName == "RandomSequence")
			{

				result = new AIRunTimeRandomSequenceNode(xmlNode);
			}
			else if (nodeName == "RandomSelector")
			{
				result = new AIRunTimeRandomSelectorNode(xmlNode);
			}
			else if (nodeName == "Inverter")
			{
				result = new AIRunTimeInverter(xmlNode);
			}
			else if (nodeName == "EntryTask")
			{
				result = new AIRunTimeEntryTaskNode(xmlNode);
			}
			else if (nodeName == "ReturnSuccess")
			{
				result = new AIRunTimeReturnSuccess(xmlNode);
			}
			else if (nodeName == "ReturnFailure")
			{
				result = new AIRunTimeReturnFailure(xmlNode);
			}
			else if (nodeName == "ConditionalEvaluator")
			{
				result = new AIRunTimeConditionalEvaluator(xmlNode);
			}
			else if (nodeName == "Log")
			{
				result = new AIRunTimeLog(xmlNode);
			}
			else if (nodeName == "RandomFloat")
			{
				result = new AIRunTimeRandomFloat(xmlNode);
			}
			else if (nodeName == "FloatOperator")
			{
				result = new AIRunTimeFloatOperator(xmlNode);
			}
			else if (nodeName == "FloatComparison")
			{
				result = new AIRunTimeFloatComparison(xmlNode);
			}
			else if (nodeName == "SetFloat")
			{
				result = new AIRunTimeSetFloat(xmlNode);
			}
			else if (nodeName == "SetBool")
			{
				result = new AIRunTimeSetBool(xmlNode);
			}
			else if (nodeName == "CompareTo")
			{
				result = new AIRunTimeCompareTo(xmlNode);
			}
			else if (nodeName == "SetInt")
			{
				result = new AIRunTimeSetInt(xmlNode);
			}
			else if (nodeName == "IntComparison")
			{
				result = new AIRunTimeIntComparison(xmlNode);
			}
			else if (nodeName == "IntOperator")
			{
				result = new AIRunTimeIntOperator(xmlNode);
			}
			else if (nodeName == "BoolComparison")
			{
				result = new AIRunTimeBoolComparison(xmlNode);
			}
			else if (nodeName == "ValueTarget")
			{
				result = new AIRunTimeValueTarget(xmlNode);
			}
			else if (nodeName == "ValueDistance")
			{
				result = new AIRunTimeValueDistance(xmlNode);
			}
			else if (nodeName == "ValueHP")
			{
				result = new AIRunTimeValueHP(xmlNode);
			}
			else if (nodeName == "ValueMP")
			{
				result = new AIRunTimeValueMP(xmlNode);
			}
			else if (nodeName == "ValueFP")
			{
				result = new AIRunTimeValueFP(xmlNode);
			}
			else if (nodeName == "StatusIdle")
			{
				result = new AIRunTimeStatusIdle(xmlNode);
			}
			else if (nodeName == "NavToTarget")
			{
				result = new AIRuntimeNavToTarget(xmlNode);
			}
			else if (nodeName == "PhysicalAttack")
			{
				result = new AIRuntimePhysicalAttack(xmlNode);
			}
			else if (nodeName == "TargetByHatredList")
			{
				result = new AIRunTimeTargetByHatredList(xmlNode);
			}
			else if (nodeName == "FindTargetByDistance")
			{
				result = new AIRunTimeFindTargetByDist(xmlNode);
			}
			else if (nodeName == "TryCastQTE")
			{
				result = new AIRuntimeTryCastQTE(xmlNode);
			}
			else if (nodeName == "CastDash")
			{
				result = new AIRuntimeCastDash(xmlNode);
			}
			else if (nodeName == "IsOppoCastingSkill")
			{
				result = new AIRunTimeIsOppoCastingSkill(xmlNode);
			}
			else if (nodeName == "IsHurtOppo")
			{
				result = new AIRunTimeIsHurtOppo(xmlNode);
			}
			else if (nodeName == "IsFixedInCd")
			{
				result = new AIRunTimeIsFixedInCd(xmlNode);
			}
			else if (nodeName == "IsWander")
			{
				result = new AIRunTimeIsWander(xmlNode);
			}
			else if (nodeName == "IsCastingSkill")
			{
				result = new AIRunTimeIsCastingSkill(xmlNode);
			}
			else if (nodeName == "IsQTEState")
			{
				result = new AIRunTimeIsQTEState(xmlNode);
			}
			else if (nodeName == "DetectEnimyInSight")
			{
				result = new AIRunTimeDetectEnimyInSight(xmlNode);
			}
			else if (nodeName == "FindTargetByHitLevel")
			{
				result = new AIRunTimeFindTargetByHitLevel(xmlNode);
			}
			else if (nodeName == "IsFighting")
			{
				result = new AIRunTimeIsFighting(xmlNode);
			}
			else if (nodeName == "DoSelectNearest")
			{
				result = new AIRunTimeDoSelectNearest(xmlNode);
			}
			else if (nodeName == "FilterSkill")
			{
				result = new AIRuntimeFilterSkill(xmlNode);
			}
			else if (nodeName == "DoSelectSkillInOrder")
			{
				result = new AIRuntimeDoSelectSkillInOrder(xmlNode);
			}
			else if (nodeName == "DoSelectSkillRandom")
			{
				result = new AIRuntimeDoSelectSkillRandom(xmlNode);
			}
			else if (nodeName == "DoCastSkill")
			{
				result = new AIRuntimeDoCastSkill(xmlNode);
			}
			else if (nodeName == "SetDest")
			{
				result = new AIRuntimeSetDest(xmlNode);
			}
			else if (nodeName == "ActionMove")
			{
				result = new AIRuntimeActionMove(xmlNode);
			}
			else if (nodeName == "ActionRotate")
			{
				result = new AIRuntimeActionRotate(xmlNode);
			}
			else if (nodeName == "FindNavPath")
			{
				result = new AIRunTimeFindNavPath(xmlNode);
			}
			else if (nodeName == "ReceiveAIEvent")
			{
				result = new AIRuntimeReceiveAIEvent(xmlNode);
			}
			else if (nodeName == "SendAIEvent")
			{
				result = new AIRuntimeSendAIEvent(xmlNode);
			}
			else if (nodeName == "SelectMoveTargetById")
			{
				result = new AIRunTimeSelectMoveTargetById(xmlNode);
			}
			else if (nodeName == "SelectItemTarget")
			{
				result = new AIRunTimeSelectItemTarget(xmlNode);
			}
			else if (nodeName == "SelectBuffTarget")
			{
				result = new AIRunTimeSelectBuffTarget(xmlNode);
			}
			else if (nodeName == "SelectTargetBySkillCircle")
			{
				result = new AIRunTimeSelectTargetBySkillCircle(xmlNode);
			}
			else if (nodeName == "SelectNonHartedList")
			{
				result = new AIRunTimeSelectNonHartedList(xmlNode);
			}
			else if (nodeName == "TargetQTEState")
			{
				result = new AIRunTimeTargetQTEState(xmlNode);
			}
			else if (nodeName == "ResetTargets")
			{
				result = new AIRunTimeResetTargets(xmlNode);
			}
			else if (nodeName == "CallMonster")
			{
				result = new AIRuntimeCallMonster(xmlNode);
			}
			else if (nodeName == "MixMonsterPos")
			{
				result = new AIRuntimeMixMonsterPos(xmlNode);
			}
			else if (nodeName == "KillMonster")
			{
				result = new AIRuntimeKillMonster(xmlNode);
			}
			else if (nodeName == "ConditionMonsterNum")
			{
				result = new AIRunTimeConditionMonsterNum(xmlNode);
			}
			else if (nodeName == "AddBuff")
			{
				result = new AIRuntimeAddBuff(xmlNode);
			}
			else if (nodeName == "RemoveBuff")
			{
				result = new AIRuntimeRemoveBuff(xmlNode);
			}
			else if (nodeName == "CallScript")
			{
				result = new AIRuntimeCallScript(xmlNode);
			}
			else if (nodeName == "IsTargetImmortal")
			{
				result = new AIRunTimeIsTargetImmortal(xmlNode);
			}
			else if (nodeName == "DetectEnemyInRange")
			{
				result = new AIRuntimeDetectEnemyInRange(xmlNode);
			}
			else if (nodeName == "StopCastingSkill")
			{
				result = new AIRuntimeCancelSkill(xmlNode);
			}
			else if (nodeName == "XHashFunc")
			{
				result = new AIRuntimeXHashFunc(xmlNode);
			}
			else if (nodeName == "RemoveSceneBuff")
			{
				result = new AIRuntimeRemoveSceneBuff(xmlNode);
			}
			else if (nodeName == "CalDistance")
			{
				result = new AIRunTimeCalDistance(xmlNode);
			}
			else if (nodeName == "Navigation")
			{
				result = new AIRuntimeActionNavigation(xmlNode);
			}
			else if (nodeName == "RotateToTarget")
			{
				result = new AIRuntimeRotateToTarget(xmlNode);
			}
			else if (nodeName == "MoveStratage")
			{
				result = new AIRuntimeMoveStratage(xmlNode);
			}
			else if (nodeName == "GetRealtimeSinceStartup")
			{
				result = new AIRunTimeGetRealtimeSinceStartup(xmlNode);
			}
			else if (nodeName == "RandomEntityPos")
			{
				result = new AIRunTimeRandomEntityPos(xmlNode);
			}
			else if (nodeName == "ConditionPlayerNum")
			{
				result = new AIRunTimeConditionPlayerNum(xmlNode);
			}
			else if (nodeName == "DoSelectFarthest")
			{
				result = new AIRunTimeDoSelectFarthest(xmlNode);
			}
			else if (nodeName == "SelectPlayerFromList")
			{
				result = new SelectPlayerFromList(xmlNode);
			}
			else if (nodeName == "SetEnmity")
			{
				result = new AIRunTimeSetEnmity(xmlNode);
			}
			else
			{
				XSingleton<XDebug>.singleton.AddErrorLog("Can't find node: ", nodeName, null, null, null, null);
				result = new AIRunTimeNodeBase(xmlNode);
			}
			return result;
		}

		// Token: 0x04003CA4 RID: 15524
		private static Dictionary<string, AIRunTimeNodeBase> _node_dic = new Dictionary<string, AIRunTimeNodeBase>();
	}
}
